package net.joke.base;

import java.util.Random;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import net.joke.base.interfaces.IEffectsSpawn;
import net.joke.base.interfaces.IMinionSpawn;

public class Config {
	public static Random random;
	
	private Config() {
		random = new Random();
//		SAXParser parse = SAXParserFactory.newInstance().newSAXParser();
		
	}
	private static Config instance;
	
	public static synchronized Config getInstance() {
		if (instance == null) {
			instance = new Config();
		}
		return instance;
	}
	
	
	public static int naturalRecoveryMsec = 5000;
	public static int textLifeMsec = 2000;
	public static float textShiftPixels = 50;
	public static float textShiftSpeed = textShiftPixels/textLifeMsec; 
	public static float defaultBulletsSpeed = 0.05f;
	
	/** 
	 * Chiamare questa funzione ogni volta che i parametri di configurazione del gioco cambiano.
	 */
	public void configChanged() {
		naturalRecoveryMsec = naturalRecoveryMsec();
		textLifeMsec = textLifeMsec();
	}
	
	public int naturalRecoveryMsec() {
		return 5000;
	}
	public int textLifeMsec() {
		return 2000;
	}
	public float defaultBulletsSpeed() {
		return defaultBulletsSpeed;
	}
	
	
	
	// sistemi
	public static IMinionSpawn minionSpawn;
	public static IEffectsSpawn effectsSpawn;
}
